import java.util.Scanner;

public class LTest {
    //有多少个不超过 2024 的正整数，与 2024 异或后结果小于 2024 。
    public static void main(String[] args) {
        int a = 2024;
        int b = 1;
        int count = 0;
        while(b<=2024){
            if((b^a)<=a){
                count++;
            }
            b++;

        }
        System.out.println(count);


    }
    public static void main4(String[] args) {
        int a = 2024;
        int b = 1024;
        while(a%b!=0){
            a+=2024;
        }
        System.out.println(a);
    }
    public static void main3(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();


        String sss = "LANQIAO";


        int count = 0;
        for(int i = 0; i < s.length()&&count<7; i++){
            if(s.charAt(i) == sss.charAt(count)){
                //arr[i]=1;
                count++;
            }
        }
        if(count == 7){
            System.out.println("YES");
        }else {
            System.out.println("NO");
        }
        return;



        /*for(char ch : s.toCharArray()){
            if(ch == 'L'){
                arr[0] = 1;
                continue;
            }else if(ch == ){}
        }*/
    }




    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
            System.out.println(arr[i]);
        }
        int minO = 0;
        for(int x:arr){
            if(x%2==0){
                minO = x;
                break;
            }
        }
        for(int x:arr){
            if(x%2==0 && x<minO){
                minO = x;
            }
        }
        System.out.println(minO);
        /*//数组长度
        int n = scanner.nextInt();
        String str = scanner.next();
        String[] strs = str.split(" ",n);
        int len = strs.length;

        //创建一个大小为n的数组
        int[] arr = new int[n];
        System.out.println("数组长度n="+n);
        for (int i = 0; i < len; i++) {
            arr[i] = Integer.parseInt(strs[i]);
            System.out.println(arr[i]);
        }*/

        //循环输入这个数组的元素
        /*for(int i = 0; i < n; i++){
            arr[i] = scanner.nextInt();
            char ch = scanner.next().charAt(0);//这句是什么意思？？？
            System.out.println(arr[i]+" "+ch);
        }*/


        /*//输入数组元素，以字符串的形式
        String str = scanner.next();
        System.out.println("str = "+str);
        arr[0] = str.charAt(0);
        for (int i = 1; i < n; i++) {

            arr[i] = str.charAt(2*i) ;

            System.out.println(arr[i]);
        }*/


        //char[] str = scanner.next().toCharArray();//这句是什么意思？？？
        //循环输入这个数组的元素
        /*for(int i = 0; i < n; i++){
            arr[i] = scanner.nextInt();
            char ch = scanner.next().charAt(0);//这句是什么意思？？？
        }*/

    }




    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        //int m = sc.nextInt();
        //System.out.println();

        //输入每桌最多人数
        int n = 0;
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();

        int a = 2024%n;
        int b = 2024/n;

        if(a == 0){
            System.out.println(b);
        }else{
            System.out.println(b+1);
        }
    }
}
